import { createRouter, createWebHistory ,createWebHashHistory } from "vue-router";
import { nowSystem } from "../utils/config";
const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: "/",
      name: "head",
      redirect: nowSystem || '/index',
      component: () => import("@/views/index.vue"),
      children: [
        // 首页
        {
          path: "/index",
          name: "index",
          component: () => import("@/views/index/index.vue"),
          meta: {
            // keepAlive: true,
          },
        },
        {
          path: "/c2c",
          name: "c2c",
          component: () => import("@/views/index/c2c.vue"),
          meta: {
            // keepAlive: true,
          },
        },
        {
          path: "/myOrder",
          name: "myOrder",
          component: () => import("@/views/index/myOrder.vue"),
          meta: {
            // keepAlive: true,
          },
        },
        {
          path: "/myC2C",
          name: "myC2C",
          component: () => import("@/views/index/myC2C.vue"),
          meta: {
            // keepAlive: true,
          },
        },
        {
          path: "/myRecord",
          name: "myRecord",
          component: () => import("@/views/index/myRecord.vue"),
          meta: {
            // keepAlive: true,
          },
        },
        {
          path: "/orderDetail2",
          name: "orderDetail2",
          component: () => import("@/views/index/orderDetail2.vue"),
        },
        {
          path: "/orderDetail",
          name: "orderDetail",
          component: () => import("@/views/index/orderDetail.vue"),
        },
        {
          path: "/shopOrder",
          name: "shopOrder",
          component: () => import("@/views/index/shopOrder.vue"),
        },
        {
          path: "/userOrder",
          name: "userOrder",
          component: () => import("@/views/index/userOrder.vue"),
        },
        {
          path: "/applyShop",
          name: "applyShop",
          component: () => import("@/views/index/addShop.vue"),
        },
        {
          path: "/auditShop",
          name: "auditShop",
          component: () => import("@/views/admin/auditShop.vue"),
        },
        {
          path: "/adminTime",
          name: "adminTime",
          component: () => import("@/views/admin/adminTime.vue"),
        },
        {
          path: "/myStar",
          name: "myStar",
          component: () => import("@/views/index/myStar.vue"),
        },
        {
          path: "/user",
          name: "user",
          component: () => import("@/views/index/user.vue"),
        },
        // 二维码页面
      ],
    },
  ],
});
export default router